/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package tv.venta.modelo;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import tv.global.modelo.CondicionDeIva;
import tv.global.modelo.Jurisdiccion;
import tv.global.modelo.Moneda;
import tv.global.modelo.Sucursal;
import tv.inventario.modelo.ListaDePrecio;

/**
 *
 * @author ctrosch
 */
@Entity
@Table(name = "VTRMVH", schema = "dbo")
public class MovimientoVenta implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected MovimientoVentaPK id;

    @Column(name = "VTRMVH_MODCOM", length = 2)
    private String modcom;
    @Basic(optional = false)
    @Column(name = "VTRMVH_CODCOM", nullable = false, length = 6)
    private String codcom;

    //Sucursal o punto de venta
    @JoinColumn(name = "VTRMVH_SUCURS", referencedColumnName = "GRTSUC_SUCURS", nullable = false)
    @ManyToOne
    private Sucursal sucursal;

    @Column(name = "VTRMVH_HSTFOR")
    private Integer hstfor;

    //Observaciones textos
    @Lob
    @Column(name = "VTRMVH_TEXTOS", length = 2147483647)
    private String textos;
    @Basic(optional = false)

    //Fecha del movimiento
    @Column(name = "VTRMVH_FCHMOV", nullable = false)
    @Temporal(TemporalType.DATE)
    private Date fchmov;
    
    //Cliente
    @JoinColumn(name = "VTRMVH_NROCTA", referencedColumnName = "VTMCLH_NROCTA", nullable = false)
    @ManyToOne(optional = false)
    private Cliente cliente;

    //Nro de subcuenta
    @Column(name = "VTRMVH_NROSUB", length = 13)
    private String nrosub;

    @Basic(optional = false)
    @Column(name = "VTRMVH_IMPTCN", nullable = false, length = 6)
    private String imptcn;

    //Lista de precio
    @JoinColumn(name = "VTRMVH_CODLIS", referencedColumnName = "STTLPR_CODLIS", nullable = false)
    @ManyToOne(optional=false)
    private ListaDePrecio listaDePrecio;

    //Condicion de pago
    @JoinColumn(name = "VTRMVH_CNDPAG", referencedColumnName = "VTTCPH_CNDPAG", nullable = false)
    @ManyToOne(optional=false)
    private CondicionDePago condicionDePago;

    //Vendedor
    @JoinColumn(name = "VTRMVH_VNDDOR", referencedColumnName = "VTTVND_VNDDOR", nullable = false)
    @ManyToOne(optional=false)
    private Vendedor vendedor;
    
    @Column(name = "VTRMVH_MODASI", length = 2)
    private String modasi;
    @Column(name = "VTRMVH_CODASI", length = 6)
    private String codasi;
    @Column(name = "VTRMVH_NROASI")
    private Integer nroasi;
    @Column(name = "VTRMVH_GRUBON", length = 6)
    private String grubon;
    @Column(name = "VTRMVH_IMPRES")
    private Short impres;
    
    //Coeficiente de deuda
    @JoinColumn(name = "VTRMVH_COFLIS", referencedColumnName = "GRTCOF_CODCOF", nullable = false)
    @ManyToOne
    private Moneda coeficienteDeuda;

    @Column(name = "VTRMVH_COBRAD", length = 6)
    private String cobrad;
    @Column(name = "VTRMVH_CAMBIO", precision = 20, scale = 8)
    private BigDecimal cambio;
    @Column(name = "VTRMVH_COFFAC", length = 6)
    private String coffac;
    @Column(name = "VTRMVH_COFDEU", length = 6)
    private String cofdeu;
    @Column(name = "VTRMVH_DIMOBL", length = 6)
    private String dimobl;
    @Column(name = "VTRMVH_SUBCUE", length = 40)
    private String subcue;
    @Column(name = "VTRMVH_DIMORI", length = 6)
    private String dimori;
    @Column(name = "VTRMVH_SUBORI", length = 40)
    private String subori;
    @Column(name = "VTRMVH_DIMUNI")
    private Character dimuni;

    //Jurisdiccion
    @JoinColumn(name = "VTRMVH_JURISD", referencedColumnName = "GRTJUR_JURISD", nullable = false)
    @ManyToOne(optional=false)
    private Jurisdiccion jurisdiccion;



    @Column(name = "VTRMVH_CODZON", length = 6)
    private String codzon;
    @Column(name = "VTRMVH_MODREV", length = 2)
    private String modrev;
    @Column(name = "VTRMVH_CODREV", length = 6)
    private String codrev;
    @Column(name = "VTRMVH_NROREV")
    private Integer nrorev;
    @Column(name = "VTRMVH_CAMUSS", precision = 20, scale = 8)
    private BigDecimal camuss;

    //Condicion de iva
    @JoinColumn(name = "VTRMVH_CNDIVA", referencedColumnName = "GRTIVA_CNDIVA", nullable = false)
    @ManyToOne
    private CondicionDeIva condicionDeIva;

    @Column(name = "VTRMVH_LOTEIN")
    private Integer lotein;
    @Column(name = "VTRMVH_DESMOV")
    private Character desmov;
    @Column(name = "VTRMVH_FCHVEN")
    @Temporal(TemporalType.DATE)
    private Date fchven;
    @Column(name = "VTRMVH_MODFCR", length = 2)
    private String modfcr;
    @Column(name = "VTRMVH_CODFCR", length = 6)
    private String codfcr;
    @Column(name = "VTRMVH_NROFCR")
    private Integer nrofcr;

    @Column(name = "VTRMVH_FECFCR")
    @Temporal(TemporalType.DATE)
    private Date fecfcr;
    @Column(name = "VTRMVH_STAFCR")
    private Short stafcr;
    @Column(name = "VTRMVH_MODRIM", length = 2)
    private String modrim;
    @Column(name = "VTRMVH_CODRIM", length = 6)
    private String codrim;
    @Column(name = "VTRMVH_NRORIM")
    private Integer nrorim;
    @Column(name = "VTRMVH_MODDCR", length = 2)
    private String moddcr;
    @Column(name = "VTRMVH_CODDCR", length = 6)
    private String coddcr;
    @Column(name = "VTRMVH_NRODCR")
    private Integer nrodcr;
    @Column(name = "VTRMVH_CAMSEC", precision = 20, scale = 8)
    private BigDecimal camsec;
    @Column(name = "VTRMVH_TIPOPR", length = 6)
    private String tipopr;
    @Column(name = "VTRMVH_CODOPR", length = 30)
    private String codopr;
    @Column(name = "VTRMVH_CODOPE", length = 6)
    private String codope;
    @Column(name = "VTRMVH_CODORI")
    private Integer codori;
    @Column(name = "VTRMVH_CODEMP", length = 10)
    private String codemp;
    @Column(name = "VTRMVH_EMPASI", length = 10)
    private String empasi;
    @Column(name = "VTRMVH_EMPDCR", length = 10)
    private String empdcr;
    @Column(name = "VTRMVH_EMPFCR", length = 10)
    private String empfcr;
    @Column(name = "VTRMVH_EMPREV", length = 10)
    private String emprev;
    @Column(name = "VTRMVH_EMPRIM", length = 10)
    private String emprim;
    @Column(name = "VTRMVH_ESTAUT")
    private Short estaut;
    @Column(name = "VTRMVH_USRAUT", length = 36)
    private String usraut;
    @Column(name = "VTRMVH_FCHAUT")
    @Temporal(TemporalType.DATE)
    private Date fchaut;
    @Column(name = "VTRMVH_ORICOM", length = 4)
    private String oricom;
    @Column(name = "VTRMVH_ORICOD", length = 20)
    private String oricod;
    @Column(name = "VTRMVH_NROCAE", length = 20)
    private String nrocae;


    @Column(name = "VTRMVH_VENCAE")
    @Temporal(TemporalType.DATE)
    private Date vencae;
    @Column(name = "VTRMVH_DOCFIS", length = 6)
    private String docfis;
    @Column(name = "VTRMVH_LETFIS", length = 6)
    private String letfis;
    @Column(name = "VTRMVH_SUCFIS", length = 6)
    private String sucfis;
    @Column(name = "VTRMVH_NROFIS")
    private Integer nrofis;
    @Column(name = "VTRMVH_FECALT")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecalt;
    @Column(name = "VTRMVH_FECMOD")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecmod;
    @Column(name = "VTRMVH_USERID", length = 15)
    private String userid;
    @Column(name = "VTRMVH_ULTOPR")
    private Character ultopr;
    @Column(name = "VTRMVH_DEBAJA")
    private Character debaja;
    @Column(name = "VTRMVH_HORMOV", length = 10)
    private String hormov;
    @Column(name = "VTRMVH_MODULE", length = 10)
    private String module;
    @Column(name = "VTRMVH_OALIAS", length = 10)
    private String oalias;
    @Lob
    @Column(name = "VTRMVH_TSTAMP")
    private byte[] tstamp;
    @Column(name = "VTRMVH_NIDCAE")
    private Integer nidcae;
    @Column(name = "VTRMVH_FCHPAR")
    @Temporal(TemporalType.DATE)
    private Date fchpar;
    @Column(name = "VTRMVH_UTPAOR")
    private Character utpaor;
    @Column(name = "VTRMVH_NIDFEX")
    private Integer nidfex;
    @Column(name = "VTRMVH_IDTFEX")
    private Integer idtfex;
    @Column(name = "VTRMVH_CNDCOM", length = 6)
    private String cndcom;
    @Column(name = "VTRMVH_TIPEXP", length = 6)
    private String tipexp;

    @OneToMany(mappedBy = "movimiento", fetch=FetchType.LAZY, cascade=CascadeType.ALL)
    private List<ItemProductoVenta> itemProducto;

    @OneToMany(mappedBy = "movimiento", fetch=FetchType.LAZY, cascade=CascadeType.ALL)
    private List<ItemImpuestoVenta> itemImpuesto;

    @OneToMany(mappedBy = "movimiento", fetch=FetchType.LAZY, cascade=CascadeType.ALL)
    private List<ItemBonificacionVenta> itemBonificacion;

    @OneToMany(mappedBy = "movimiento", fetch=FetchType.LAZY, cascade=CascadeType.ALL)
    private List<ItemPercepcionVenta> itemPercepcion;

    @OneToMany(mappedBy = "movimiento", fetch=FetchType.LAZY, cascade=CascadeType.ALL)
    private List<ItemTotal> itemTotal;

    @Transient
    private BigDecimal subtotalConIVA;

    @Transient
    private BigDecimal subtotalSinIVA;



    public MovimientoVenta() {
    }

    public MovimientoVenta(MovimientoVentaPK id) {
        this.id = id;
    }

    public MovimientoVenta(MovimientoVentaPK id, String codcom, Date fchmov, Cliente cliente) {
        this.id = id;
        this.codcom = codcom;
        this.fchmov = fchmov;
        this.cliente = cliente;        
        
    }

    public MovimientoVenta(String vtrmvhModfor, String vtrmvhCodfor, int vtrmvhNrofor) {
        this.id = new MovimientoVentaPK(vtrmvhModfor, vtrmvhCodfor, vtrmvhNrofor);
    }

    public MovimientoVentaPK getId() {
        return id;
    }

    public void setId(MovimientoVentaPK id) {
        this.id = id;
    }

    public BigDecimal getCambio() {
        return cambio;
    }

    public void setCambio(BigDecimal cambio) {
        this.cambio = cambio;
    }

    public BigDecimal getCamsec() {
        return camsec;
    }

    public void setCamsec(BigDecimal camsec) {
        this.camsec = camsec;
    }

    public BigDecimal getCamuss() {
        return camuss;
    }

    public void setCamuss(BigDecimal camuss) {
        this.camuss = camuss;
    }

    public Cliente getCliente() {
        return cliente;
    }

    public void setCliente(Cliente cliente) {
        this.cliente = cliente;
    }

    public String getCndcom() {
        return cndcom;
    }

    public void setCndcom(String cndcom) {
        this.cndcom = cndcom;
    }

    public String getCobrad() {
        return cobrad;
    }

    public void setCobrad(String cobrad) {
        this.cobrad = cobrad;
    }

    public String getCodasi() {
        return codasi;
    }

    public void setCodasi(String codasi) {
        this.codasi = codasi;
    }

    public String getCodcom() {
        return codcom;
    }

    public void setCodcom(String codcom) {
        this.codcom = codcom;
    }

    public String getCoddcr() {
        return coddcr;
    }

    public void setCoddcr(String coddcr) {
        this.coddcr = coddcr;
    }

    public String getCodemp() {
        return codemp;
    }

    public void setCodemp(String codemp) {
        this.codemp = codemp;
    }

    public String getCodfcr() {
        return codfcr;
    }

    public void setCodfcr(String codfcr) {
        this.codfcr = codfcr;
    }

    public String getCodope() {
        return codope;
    }

    public void setCodope(String codope) {
        this.codope = codope;
    }

    public String getCodopr() {
        return codopr;
    }

    public void setCodopr(String codopr) {
        this.codopr = codopr;
    }

    public Integer getCodori() {
        return codori;
    }

    public void setCodori(Integer codori) {
        this.codori = codori;
    }

    public String getCodrev() {
        return codrev;
    }

    public void setCodrev(String codrev) {
        this.codrev = codrev;
    }

    public String getCodrim() {
        return codrim;
    }

    public void setCodrim(String codrim) {
        this.codrim = codrim;
    }

    public String getCodzon() {
        return codzon;
    }

    public void setCodzon(String codzon) {
        this.codzon = codzon;
    }

    public Moneda getCoeficienteDeuda() {
        return coeficienteDeuda;
    }

    public void setCoeficienteDeuda(Moneda coeficienteDeuda) {
        this.coeficienteDeuda = coeficienteDeuda;
    }

    public String getCofdeu() {
        return cofdeu;
    }

    public void setCofdeu(String cofdeu) {
        this.cofdeu = cofdeu;
    }

    public String getCoffac() {
        return coffac;
    }

    public void setCoffac(String coffac) {
        this.coffac = coffac;
    }

    public CondicionDeIva getCondicionDeIva() {
        return condicionDeIva;
    }

    public void setCondicionDeIva(CondicionDeIva condicionDeIva) {
        this.condicionDeIva = condicionDeIva;
    }

    public CondicionDePago getCondicionDePago() {
        return condicionDePago;
    }

    public void setCondicionDePago(CondicionDePago condicionDePago) {
        this.condicionDePago = condicionDePago;
    }

    public Character getDebaja() {
        return debaja;
    }

    public void setDebaja(Character debaja) {
        this.debaja = debaja;
    }

    public Character getDesmov() {
        return desmov;
    }

    public void setDesmov(Character desmov) {
        this.desmov = desmov;
    }

    public String getDimobl() {
        return dimobl;
    }

    public void setDimobl(String dimobl) {
        this.dimobl = dimobl;
    }

    public String getDimori() {
        return dimori;
    }

    public void setDimori(String dimori) {
        this.dimori = dimori;
    }

    public Character getDimuni() {
        return dimuni;
    }

    public void setDimuni(Character dimuni) {
        this.dimuni = dimuni;
    }

    public String getDocfis() {
        return docfis;
    }

    public void setDocfis(String docfis) {
        this.docfis = docfis;
    }

    public String getEmpasi() {
        return empasi;
    }

    public void setEmpasi(String empasi) {
        this.empasi = empasi;
    }

    public String getEmpdcr() {
        return empdcr;
    }

    public void setEmpdcr(String empdcr) {
        this.empdcr = empdcr;
    }

    public String getEmpfcr() {
        return empfcr;
    }

    public void setEmpfcr(String empfcr) {
        this.empfcr = empfcr;
    }

    public String getEmprev() {
        return emprev;
    }

    public void setEmprev(String emprev) {
        this.emprev = emprev;
    }

    public String getEmprim() {
        return emprim;
    }

    public void setEmprim(String emprim) {
        this.emprim = emprim;
    }

    public Short getEstaut() {
        return estaut;
    }

    public void setEstaut(Short estaut) {
        this.estaut = estaut;
    }

    public Date getFchaut() {
        return fchaut;
    }

    public void setFchaut(Date fchaut) {
        this.fchaut = fchaut;
    }

    public Date getFchmov() {
        return fchmov;
    }

    public void setFchmov(Date fchmov) {
        this.fchmov = fchmov;
    }

    public Date getFchpar() {
        return fchpar;
    }

    public void setFchpar(Date fchpar) {
        this.fchpar = fchpar;
    }

    public Date getFchven() {
        return fchven;
    }

    public void setFchven(Date fchven) {
        this.fchven = fchven;
    }

    public Date getFecalt() {
        return fecalt;
    }

    public void setFecalt(Date fecalt) {
        this.fecalt = fecalt;
    }

    public Date getFecfcr() {
        return fecfcr;
    }

    public void setFecfcr(Date fecfcr) {
        this.fecfcr = fecfcr;
    }

    public Date getFecmod() {
        return fecmod;
    }

    public void setFecmod(Date fecmod) {
        this.fecmod = fecmod;
    }

    public String getGrubon() {
        return grubon;
    }

    public void setGrubon(String grubon) {
        this.grubon = grubon;
    }

    public String getHormov() {
        return hormov;
    }

    public void setHormov(String hormov) {
        this.hormov = hormov;
    }

    public Integer getHstfor() {
        return hstfor;
    }

    public void setHstfor(Integer hstfor) {
        this.hstfor = hstfor;
    }

    public Integer getIdtfex() {
        return idtfex;
    }

    public void setIdtfex(Integer idtfex) {
        this.idtfex = idtfex;
    }

    public Short getImpres() {
        return impres;
    }

    public void setImpres(Short impres) {
        this.impres = impres;
    }

    public List<ItemBonificacionVenta> getItemBonificacion() {
        return itemBonificacion;
    }

    public void setItemBonificacion(List<ItemBonificacionVenta> itemBonificacion) {
        this.itemBonificacion = itemBonificacion;
    }

    public List<ItemImpuestoVenta> getItemImpuesto() {
        return itemImpuesto;
    }

    public void setItemImpuesto(List<ItemImpuestoVenta> itemImpuesto) {
        this.itemImpuesto = itemImpuesto;
    }

    public List<ItemPercepcionVenta> getItemPercepcion() {
        return itemPercepcion;
    }

    public void setItemPercepcion(List<ItemPercepcionVenta> itemPercepcion) {
        this.itemPercepcion = itemPercepcion;
    }

    public List<ItemProductoVenta> getItemProducto() {
        return itemProducto;
    }

    public void setItemProducto(List<ItemProductoVenta> itemProducto) {
        this.itemProducto = itemProducto;
    }

    public List<ItemTotal> getItemTotal() {
        return itemTotal;
    }

    public void setItemTotal(List<ItemTotal> itemTotal) {
        this.itemTotal = itemTotal;
    }

    public Jurisdiccion getJurisdiccion() {
        return jurisdiccion;
    }

    public void setJurisdiccion(Jurisdiccion jurisdiccion) {
        this.jurisdiccion = jurisdiccion;
    }

    public String getLetfis() {
        return letfis;
    }

    public void setLetfis(String letfis) {
        this.letfis = letfis;
    }

    public ListaDePrecio getListaDePrecio() {
        return listaDePrecio;
    }

    public void setListaDePrecio(ListaDePrecio listaDePrecio) {
        this.listaDePrecio = listaDePrecio;
    }

    public Integer getLotein() {
        return lotein;
    }

    public void setLotein(Integer lotein) {
        this.lotein = lotein;
    }

    public String getModasi() {
        return modasi;
    }

    public void setModasi(String modasi) {
        this.modasi = modasi;
    }

    public String getModcom() {
        return modcom;
    }

    public void setModcom(String modcom) {
        this.modcom = modcom;
    }

    public String getModdcr() {
        return moddcr;
    }

    public void setModdcr(String moddcr) {
        this.moddcr = moddcr;
    }

    public String getModfcr() {
        return modfcr;
    }

    public void setModfcr(String modfcr) {
        this.modfcr = modfcr;
    }

    public String getModrev() {
        return modrev;
    }

    public void setModrev(String modrev) {
        this.modrev = modrev;
    }

    public String getModrim() {
        return modrim;
    }

    public void setModrim(String modrim) {
        this.modrim = modrim;
    }

    public String getModule() {
        return module;
    }

    public void setModule(String module) {
        this.module = module;
    }

    public Integer getNidcae() {
        return nidcae;
    }

    public void setNidcae(Integer nidcae) {
        this.nidcae = nidcae;
    }

    public Integer getNidfex() {
        return nidfex;
    }

    public void setNidfex(Integer nidfex) {
        this.nidfex = nidfex;
    }

    public Integer getNroasi() {
        return nroasi;
    }

    public void setNroasi(Integer nroasi) {
        this.nroasi = nroasi;
    }

    public String getNrocae() {
        return nrocae;
    }

    public void setNrocae(String nrocae) {
        this.nrocae = nrocae;
    }

    public Integer getNrodcr() {
        return nrodcr;
    }

    public void setNrodcr(Integer nrodcr) {
        this.nrodcr = nrodcr;
    }

    public Integer getNrofcr() {
        return nrofcr;
    }

    public void setNrofcr(Integer nrofcr) {
        this.nrofcr = nrofcr;
    }

    public Integer getNrofis() {
        return nrofis;
    }

    public void setNrofis(Integer nrofis) {
        this.nrofis = nrofis;
    }

    public Integer getNrorev() {
        return nrorev;
    }

    public void setNrorev(Integer nrorev) {
        this.nrorev = nrorev;
    }

    public Integer getNrorim() {
        return nrorim;
    }

    public void setNrorim(Integer nrorim) {
        this.nrorim = nrorim;
    }

    public String getNrosub() {
        return nrosub;
    }

    public void setNrosub(String nrosub) {
        this.nrosub = nrosub;
    }

    public String getOalias() {
        return oalias;
    }

    public void setOalias(String oalias) {
        this.oalias = oalias;
    }

    public String getOricod() {
        return oricod;
    }

    public void setOricod(String oricod) {
        this.oricod = oricod;
    }

    public String getOricom() {
        return oricom;
    }

    public void setOricom(String oricom) {
        this.oricom = oricom;
    }

    public Short getStafcr() {
        return stafcr;
    }

    public void setStafcr(Short stafcr) {
        this.stafcr = stafcr;
    }

    public String getSubcue() {
        return subcue;
    }

    public void setSubcue(String subcue) {
        this.subcue = subcue;
    }

    public String getSubori() {
        return subori;
    }

    public void setSubori(String subori) {
        this.subori = subori;
    }

    public String getSucfis() {
        return sucfis;
    }

    public void setSucfis(String sucfis) {
        this.sucfis = sucfis;
    }

    public Sucursal getSucursal() {
        return sucursal;
    }

    public void setSucursal(Sucursal sucursal) {
        this.sucursal = sucursal;
    }

    public String getTextos() {
        return textos;
    }

    public void setTextos(String textos) {
        this.textos = textos;
    }

    public String getTipexp() {
        return tipexp;
    }

    public void setTipexp(String tipexp) {
        this.tipexp = tipexp;
    }

    public String getTipopr() {
        return tipopr;
    }

    public void setTipopr(String tipopr) {
        this.tipopr = tipopr;
    }

    public byte[] getTstamp() {
        return tstamp;
    }

    public void setTstamp(byte[] tstamp) {
        this.tstamp = tstamp;
    }

    public Character getUltopr() {
        return ultopr;
    }

    public void setUltopr(Character ultopr) {
        this.ultopr = ultopr;
    }

    public String getUserid() {
        return userid;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }

    public String getUsraut() {
        return usraut;
    }

    public void setUsraut(String usraut) {
        this.usraut = usraut;
    }

    public Character getUtpaor() {
        return utpaor;
    }

    public void setUtpaor(Character utpaor) {
        this.utpaor = utpaor;
    }

    public Date getVencae() {
        return vencae;
    }

    public void setVencae(Date vencae) {
        this.vencae = vencae;
    }

    public Vendedor getVendedor() {
        return vendedor;
    }

    public void setVendedor(Vendedor vendedor) {
        this.vendedor = vendedor;
    }

    public String getImptcn() {
        return imptcn;
    }

    public void setImptcn(String imptcn) {
        this.imptcn = imptcn;
    }

    public BigDecimal getSubtotalConIVA() {
        subtotalConIVA = BigDecimal.ZERO;

        if(itemProducto!=null){
            for(ItemProductoVenta i: itemProducto){
            subtotalConIVA = subtotalConIVA.add(i.getTotalLineaConIVA());
            }
        }
        return subtotalConIVA;
    }

    public void setSubtotalConIVA(BigDecimal subtotalConIVA) {
        this.subtotalConIVA = subtotalConIVA;
    }

    public BigDecimal getSubtotalSinIVA() {
        subtotalSinIVA = BigDecimal.ZERO;

        if(itemProducto!=null){
            for(ItemProductoVenta i: itemProducto){
            subtotalSinIVA = subtotalSinIVA.add(i.getImpnac());
            }
        }
        return subtotalSinIVA;        
    }

    public void setSubtotalSinIVA(BigDecimal subtotalSinIVA) {
        this.subtotalSinIVA = subtotalSinIVA;
    }

    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MovimientoVenta)) {
            return false;
        }
        MovimientoVenta other = (MovimientoVenta) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "tv.venta.modelo.MovimientoVenta[id=" + id + "]";
    }

}
